package com.core.exception;

import com.core.enums.ResultCodeEnums;
import lombok.Getter;

/**
 * 自定义业务异常
 * @author hc
 * @CreateTime 2025/7/29 14:34
 */
@Getter
public class BizException extends RuntimeException {
    private final String code;
    private final String message;

    public BizException(String message) {
        this(ResultCodeEnums.INTERNAL_SERVER_ERROR.getCode(), message);
    }

    public BizException(String code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    @Override
    public String getMessage() { return message; }
}
